finalfantasyfandomcom_pl-20200213-history
Szablon:Navbox/doc
This is a meta-template for building navboxes. A navbox is a grouping of links used in multiple related articles to facilitate navigation between those pages. Up to 20 headers/blocks with up to 20 content/group fields each are supported, as well as displaying the rows in a column-based or horizontal layout and making groups collapsible. Each of these options can be specified for individual blocks or the whole navbox. In addition, navboxes built with this meta-template can be nested/displayed within each other. The template also supports displaying images to the left and/or right of individual blocks or the whole navbox. Standard navboxes (i.e. those inserted at the bottom of an article) are collapsible and will be auto-collapsed by default (this can be changed by altering the autocollapse limit in MediaWiki:Common.js). Usage is a metatemplate, meaning it is a template for other templates. So, a navbox, , will be built using "Navbox" as its base code, and once created, a user only needs to add to the bottom of an article for it to be put in place. This code is primarily for building other navboxes, not for being used on articles. Copy/paste } |name =Navbox example |title =Title |contentA1 =Links }} Easy navbox creation The box below allows you to create a new with the appropriate layout. Simply enter the name of the new navbox ("Template:Navbox" is automatically added) and click the "Create" button. Common parameters } (see the example under "Usage") if it is in use. It allows the layout of the navbox to be changed so it fits inside another navbox, if the parameter is set to "nested" from within the other navbox. This should only be used if it is supposed to be nested; if it is not being nested, it should not be used. }} . For columns, use (inserted with *). }} template call. }} Options parameters The various options (often referred to as an options param) are to be used when the navbox is different to the default setting. For instance, changing to side navboxes, changing whether a navbox should be collapsible, or changing things such as the width. Some parameters should be used more sparingly than others. Class parameters The class options in order to change based on already set CSS classes in the Common.css. These classes are defined by a . This option is essential to most navboxes. While most times, simply applying a class to an entire navbox normally works, there may be times where more than one is useful. Classes can be found here. Style parameters Unlike class, the style options should be used sparingly as they can lead to visual inconsistencies. They are often preferred when a css class does not exist to be used. Examples Simple A simple usage of the navbox would be: } |editlink =Navbox/doc |class =series |title =Title |contentA1 =Content A }} results in: } |editlink =Navbox/doc |class =series |title =Title |contentA1 =Content A }} Every navbox is required to include an editlink, a class, a title, and at least some content. These are the bare necessities for every navbox. Note, that if only a single "contents" exists, it is more likely that the navbox will become a side navbox instead (more on those later). Functionality and explanations The basic functionality of the Navbox metatemplate's parameters used in practice to construct navboxes will be explained here. "Standard" refers to groups, blocks and headers. |-| Standard (image)= } |image =Wiki.png |title =Title |blockA =Block A |groupA1 =Group A1 |contentA1 =Content A1 |contentA2 =Content A2 |headerB =Header B |blockB =Block B |groupB1 =Group B2 |contentB1 =Content B1 }} results in: } |image =Wiki.png |title =Title |blockA =Block A |groupA1 =Group A1 |contentA1 =Content A1 |contentA2 =Content A2 |headerB =Header B |blockB =Block B |groupB1 =Group B2 |contentB1 =Content B1 }} As shown about, all the "A" content is grouped under the "A" block, however, all the "B" content is grouped not only under the "B" block, but under a collapsible header. The image is applied to the right of the entire navbox. |-| Standard (block images)= } |title =Title |imageA =Wiki.png |headerA =Header A |groupA1 =Group A1 |contentA1 =Content A1 |contentA2 =Content A2 |groupA3 =Group A3 |contentA3 =Content A3 |imageB =Wiki.png |headerB =Header B |groupB1 =Group B1 |contentB1 =Content B1 |groupB2 =Group B2 |contentB2 =Content B2 |groupB3 =Group B3 |contentB3 =Content B3 }} results in: } |title =Title |imageA =Wiki.png |headerA =Header A |groupA1 =Group A1 |contentA1 =Content A1 |contentA2 =Content A2 |groupA3 =Group A3 |contentA3 =Content A3 |imageB =Wiki.png |headerB =Header B |groupB1 =Group B1 |contentB1 =Content B1 |groupB2 =Group B2 |contentB2 =Content B2 |groupB3 =Group B3 |contentB3 =Content B3 }} The images here were applied to the "A" and "B" contents, as opposed to the entire box. When adding images to large navboxes, this is always preferred. Note, that if "blocks" were used instead of "headers", the same result would be produced. The same result would also be produced if neither headers nor blocks were used. |-| Columns (entire navbox)= } |title =Title |options =columns |contentA1 =Content A1 |contentA2 =Content A2 |contentA3 =Content A3 |contentB1 =Content B1 |contentB2 =Content B2 |contentB3 =Content B3 }} results in: } |title =Title |options =columns |contentA1 =Content A1 |contentA2 =Content A2 |contentA3 =Content A3 |contentB1 =Content B1 |contentB2 =Content B2 |contentB3 =Content B3 }} By simply changing the "options" value to add "columns", the navbox's contents now don't add new rows, but new columns. Groups appear in the row above contents. Note, that while groups can be added, and will appear in the row above the contents, they are not preferred. To add contents in a row below, simply add them to a different letter. Be careful when adding more than 10 to a row, as while doable, it will often look untidy and make the contents unnecessarily small. |-| Columns (standard rows mixed)= } |title =Title |optionsA =columns |headerA =Header A |contentA1 =Content A1 |contentA2 =Content A2 |headerB =Header B |groupB1 =Group B1 |contentB1 =Content B1 |groupB2 =Group B2 |contentB2 =Content B2 }} results in: } |title =Title |optionsA =columns |headerA =Header A |contentA1 =Content A1 |contentA2 =Content A2 |headerB =Header B |groupB1 =Group B1 |contentB1 =Content B1 |groupB2 =Group B2 |contentB2 =Content B2 }} The options parameter does not just apply to the entire navbox, it can apply to individual letters. Sometimes colums are preferred, though sometimes they are not. |-| Side navbox= } |title =Title |position =right |width =25em |optionsA =columns |headerA =Header A |contentA1 =Content A1 |contentA2 =Content A2 |contentA3 =Content A3 |headerB =Header B |contentB1 =Content B1 |contentB2 =Content B2 |contentB3 =Content B3 }} } |title =Title |position =right |width =25em |optionsA =columns |headerA =Header A |contentA1 =Content A1 |contentA2 =Content A2 |contentA3 =Content A3 |headerB =Header B |contentB1 =Content B1 |contentB2 =Content B2 |contentB3 =Content B3 }} For some navboxes, particularly ones with less content, using the "position" parameter and setting it to either left or right can make it a side navbox. This is often useful when the navbox is only meant to make lists. Note, that it is important, though unnecessary, to specify the width of the side navboxes, in order to give the contents more room. Also note that the side navs prefer listing things with "*" and "#" (the bullet points will not actually show, but numbers will). |-| Nested navboxes= } |title =Title |nestedplainA = |nestedplainB = |groupC1 =(Un-nested) Group C1 |contentC1 =(Un-nested) Group C1 }} } |title =Title |nestedplainA = |nestedplainB = |groupC1 =(Un-nested) Group C1 |contentC1 =(Un-nested) Group C1 }} Nested navboxes are especially useful when more information is needed under a header. Particularly, for navboxes when multiple blocks are needed in the contents under what would otherwise be a header. Since placing multiple blocks under a header is impossible, a nested navbox fills that role. Otherwise, they are often unnecessary, as headers can already be styled, classed, given images and other functions normally; that, and the number of contents should almost never exceed 20, though if they do, nested navboxes can be added. Customization features The Navbox metatemplate is designed to allow for plenty of customization to its appearance. Through the use of style and class parameters, the metatemplate can be applied used for every situation and colored based on the wiki's own classes, which are based on the games. It also allows for bg images. Class= } |title =Title |class =FFVI |contentA1 =Content A1 }} results in: } |title =Title |class =FFVI |contentA1 =Content A1 }} Adding FFVI pulled up the FFVI class from the Wiki's Common.css, and colored the entire template automatically as an FFVI template. It did not, however, provide title text or a bg image. This is because, while the navbox is an FFVI navbox, it is not an FFVI navbox for the whole game. |-| Multiple classes= } |title =Title |class =FFIV |headerA =Header A (unclassed) |contentA1 =Content A1 (unclassed) |headerB =Header B |headerB class =FFV |contentB1 =Content B1 |headerC =Header C |headerC class =FFX |contentC1 =Content C1 }} results in: } |title =Title |class =FFIV |headerA =Header A (unclassed) |contentA1 =Content A1 (unclassed) |headerB =Header B |headerB class =FFV |contentB1 =Content B1 |headerC =Header C |headerC class =FFX |contentC1 =Content C1 }} While the template was classed like an FFIV template, for the whole thing, as headers B and C referred to other games, they were classed as such, so FFV and FFX were used as classes specified only for them. |-| Style= } |class =FFVIII |title =Title |style =background-color: #FFFF00; text-align: center; |contentA1 =Content A1 |contentA2 =Content A2 }} results in: } |class =FFVIII |title =Title |style =background-color: #FFFF00; text-align: left; |contentA1 =Content A1 |contentA2 =Content A2 }} The navbox was given a yellow background color and its text was aligned to the left. This was applied to everything in the navbox. This style is in contrast to the class, used, which in this case was FFVIII. |-| Multiple styles= } |class =FFXIII |title =Title |title style =background-color: #FF0000; |styleA =background-color: #008000; |headerA =Header A |contentA1 =Content A1 |headerB =Header B |headerB style =background-color: #0000FF; |contentB1 =Content B1 |contentB1 style =text-align: left; |contentB2 =Content B2 |contentB2 style =text-align: center; }} results in: } |class =FFXIII |title =Title |title style =background-color: #FF0000; |styleA =background-color: #008000; |headerA =Header A |contentA1 =Content A1 |headerB =Header B |headerB style =background-color: #FFFF00; |contentB1 =Content B1 |contentB1 style =text-align: left; |contentB2 =Content B2 |contentB2 style =text-align: center; }} Here, the title has been made red, while everything in A was given a green background. Only the header of B was given a background, which was yellow. The texts in the contents have been aligned differently. Everything else, however, has gone by the default, which was the FFXIII class. |-| Title text and bg image= } |title =Title |class =FFVII |editlink =FFVII |contentA1 =Content A1 }} results in: } |title =Title |class =FFVII |editlink =FFVII |contentA1 =Content A1 }} Filling in the "editlink" triggers the bg image. It identifies that the navbox being built is a navbox for the game, and deserves the bg image and title text. Examples in use Examples of navboxes actually in use are as follows: ; :Uses bg image, class, headers, and a nested navbox ; :Uses columns, headers ; :Uses multiple different classes, headers, blocks, and nested navboxes ; :Uses positioning (as a sidenav) Technical This metatemplate is fairly complicated. Editing it requires a good understanding of parser functions and wiki syntax. For help editing, or using, contact the designers for help. Auxiliaries The metatemplate also uses several "auxiliary" templates in its construction. The main purpose of these is to simplify the amount of content on the main metatemplate, and make it easier to edit. ; :Merges various input parameters, calculates row/column counts for a given block and passes results to aux2 or aux3 (depending on the specified layout type). ; :Returns a whole block of standard rows according to options and specified cells. ; :Returns a whole block of columns according to options and specified cells. Background images The navboxes which use a background image (referred to as "bg" image) import the images from the Common.js and Common.css, which are hosted on the FF wiki. The images are all 170x30 in resolution. Anyone can upload an image for the navboxes. The background images should only be featured on navboxes for the game in question. They are triggered by the "editlink" param (see above). Since the navbox name will be identical to the game's class and code name, the editlink should be too, meaning it will activate the js and css. The images can be found on . When a background image is used, the titletext replaces normal text. Documentation for all navboxes A documentation exists for the individual navboxes, as opposed to just this metatemplate. It can be found on . Development credit The metatemplate was originally based on code found on the Fallout Wiki. However, since introduction, Technobliterator and JBed heavily modified it until both its design and structure were very different. The main differences are: *Instead of being heavily based around the HTML s more often, mainly in its headers. *As mentioned above, the FFwiki's navbox also makes heavy usage of its game classes. *The navbox importants from the CSS and JavaScript to use its various logo images. *The Fallout Wiki's navbox is much more limited, only capable of 8x8. There are plans to possibly use Lua in the future to make code easier. tag, while it still contains the tag, it uses